this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["attribute-filter"]=function(e){function t(t){for(var c,a,l=t[0],s=t[1],i=t[2],b=0,d=[];b<l.length;b++)a=l[b],Object.prototype.hasOwnProperty.call(r,a)&&r[a]&&d.push(r[a][0]),r[a]=0;for(c in s)Object.prototype.hasOwnProperty.call(s,c)&&(e[c]=s[c]);for(u&&u(t);d.length;)d.shift()();return o.push.apply(o,i||[]),n()}function n(){for(var e,t=0;t<o.length;t++){for(var n=o[t],c=!0,l=1;l<n.length;l++){var s=n[l];0!==r[s]&&(c=!1)}c&&(o.splice(t--,1),e=a(a.s=n[0]))}return e}var c={},r={8:0,1:0},o=[];function a(t){if(c[t])return c[t].exports;var n=c[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,a),n.l=!0,n.exports}a.m=e,a.c=c,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var c in e)a.d(n,c,function(t){return e[t]}.bind(null,c));return n},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="";var l=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],s=l.push.bind(l);l.push=t,l=l.slice();for(var i=0;i<l.length;i++)t(l[i]);var u=s;return o.push([438,0]),n()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},10:function(e,t){e.exports=window.wp.htmlEntities},102:function(e,t,n){"use strict";n.d(t,"a",(function(){return _}));var c=n(0),r=n(1),o=n(2),a=n(70),l=n(614),s=n(4),i=n.n(s),u=n(11),b=n(16),d=n(35),m=n(613),p=n(10);n(55);const g=({id:e,label:t,popoverContents:n,remove:l,screenReaderLabel:s,className:b=""})=>{const[d,O]=Object(c.useState)(!1),j=Object(u.useInstanceId)(g);if(s=s||t,!t)return null;t=Object(p.decodeEntities)(t);const f=i()("woocommerce-tag",b,{"has-remove":!!l}),h=`woocommerce-tag__label-${j}`,w=Object(c.createElement)(c.Fragment,null,Object(c.createElement)("span",{className:"screen-reader-text"},s),Object(c.createElement)("span",{"aria-hidden":"true"},t));return Object(c.createElement)("span",{className:f},n?Object(c.createElement)(o.Button,{className:"woocommerce-tag__text",id:h,onClick:()=>O(!0)},w):Object(c.createElement)("span",{className:"woocommerce-tag__text",id:h},w),n&&d&&Object(c.createElement)(o.Popover,{onClose:()=>O(!1)},n),l&&Object(c.createElement)(o.Button,{className:"woocommerce-tag__remove",onClick:l(e),label:Object(r.sprintf)(
// Translators: %s label.
Object(r.__)("Remove %s","woocommerce"),t),"aria-describedby":h},Object(c.createElement)(a.a,{icon:m.a,size:20,className:"clear-icon"})))};var O=g;n(54);const j=e=>Object(c.createElement)(d.b,{...e}),f=e=>{const{list:t,selected:n,renderItem:r,depth:o=0,onSelect:a,instanceId:l,isSingle:s,search:i,useExpandedPanelId:u}=e,[b]=u;return t?Object(c.createElement)(c.Fragment,null,t.map((t=>{var d,m;const p=null!==(d=t.children)&&void 0!==d&&d.length&&!s?t.children.every((({id:e})=>n.find((t=>t.id===e)))):!!n.find((({id:e})=>e===t.id)),g=(null===(m=t.children)||void 0===m?void 0:m.length)&&b===t.id;return Object(c.createElement)(c.Fragment,{key:t.id},Object(c.createElement)("li",null,r({item:t,isSelected:p,onSelect:a,isSingle:s,selected:n,search:i,depth:o,useExpandedPanelId:u,controlId:l})),g?Object(c.createElement)(f,{...e,list:t.children,depth:o+1}):null)}))):null},h=({isLoading:e,isSingle:t,selected:n,messages:a,onChange:l,onRemove:s})=>{if(e||t||!n)return null;const i=n.length;return Object(c.createElement)("div",{className:"woocommerce-search-list__selected"},Object(c.createElement)("div",{className:"woocommerce-search-list__selected-header"},Object(c.createElement)("strong",null,a.selected(i)),i>0?Object(c.createElement)(o.Button,{isLink:!0,isDestructive:!0,onClick:()=>l([]),"aria-label":a.clear},Object(r.__)("Clear all","woocommerce")):null),i>0?Object(c.createElement)("ul",null,n.map(((e,t)=>Object(c.createElement)("li",{key:t},Object(c.createElement)(O,{label:e.name,id:e.id,remove:s}))))):null)},w=({filteredList:e,search:t,onSelect:n,instanceId:o,useExpandedPanelId:s,...i})=>{const{messages:u,renderItem:b,selected:d,isSingle:m}=i,p=b||j;return 0===e.length?Object(c.createElement)("div",{className:"woocommerce-search-list__list is-not-found"},Object(c.createElement)("span",{className:"woocommerce-search-list__not-found-icon"},Object(c.createElement)(a.a,{icon:l.a})),Object(c.createElement)("span",{className:"woocommerce-search-list__not-found-text"},t?Object(r.sprintf)(u.noResults,t):u.noItems)):Object(c.createElement)("ul",{className:"woocommerce-search-list__list"},Object(c.createElement)(f,{useExpandedPanelId:s,list:e,selected:d,renderItem:p,onSelect:n,instanceId:o,isSingle:m,search:t}))},_=e=>{const{className:t="",isCompact:n,isHierarchical:a,isLoading:l,isSingle:s,list:d,messages:m=b.a,onChange:p,onSearch:g,selected:O,type:j="text",debouncedSpeak:f}=e,[y,E]=Object(c.useState)(""),k=Object(c.useState)(-1),v=Object(u.useInstanceId)(_),S=Object(c.useMemo)((()=>({...b.a,...m})),[m]),C=Object(c.useMemo)((()=>Object(b.c)(d,y,a)),[d,y,a]);Object(c.useEffect)((()=>{f&&f(S.updated)}),[f,S]),Object(c.useEffect)((()=>{"function"==typeof g&&g(y)}),[y,g]);const x=Object(c.useCallback)((e=>()=>{s&&p([]);const t=O.findIndex((({id:t})=>t===e));p([...O.slice(0,t),...O.slice(t+1)])}),[s,O,p]),N=Object(c.useCallback)((e=>()=>{Array.isArray(e)?p(e):-1===O.findIndex((({id:t})=>t===e.id))?p(s?[e]:[...O,e]):x(e.id)()}),[s,x,p,O]),T=Object(c.useCallback)((e=>{const[t]=O.filter((t=>!e.find((e=>t.id===e.id))));x(t.id)()}),[x,O]);return Object(c.createElement)("div",{className:i()("woocommerce-search-list",t,{"is-compact":n,"is-loading":l,"is-token":"token"===j})},"text"===j&&Object(c.createElement)(h,{...e,onRemove:x,messages:S}),Object(c.createElement)("div",{className:"woocommerce-search-list__search"},"text"===j?Object(c.createElement)(o.TextControl,{label:S.search,type:"search",value:y,onChange:e=>E(e)}):Object(c.createElement)(o.FormTokenField,{disabled:l,label:S.search,onChange:T,onInputChange:e=>E(e),suggestions:[],__experimentalValidateInput:()=>!1,value:l?[Object(r.__)("Loading…","woocommerce")]:O.map((e=>({...e,value:e.name}))),__experimentalShowHowTo:!1})),l?Object(c.createElement)("div",{className:"woocommerce-search-list__list"},Object(c.createElement)(o.Spinner,null)):Object(c.createElement)(w,{...e,search:y,filteredList:C,messages:S,onSelect:N,instanceId:v,useExpandedPanelId:k}))};Object(o.withSpokenMessages)(_)},103:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var c=n(0);function r(e,t){const n=Object(c.useRef)();return Object(c.useEffect)((()=>{n.current===e||t&&!t(e,n.current)||(n.current=e)}),[e,t]),n.current}},108:function(e,t){e.exports=window.wp.warning},11:function(e,t){e.exports=window.wp.compose},113:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));const c=e=>"string"==typeof e},114:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var c=n(0);const r=Object(c.createContext)({}),o=()=>{const{wrapper:e}=Object(c.useContext)(r);return t=>{e&&e.current&&(e.current.hidden=!t)}}},120:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var c=n(8),r=n(6),o=n(0),a=n(47);const l=e=>{const{namespace:t,resourceName:n,resourceValues:l=[],query:s={},shouldSelect:i=!0}=e;if(!t||!n)throw new Error("The options object must have valid values for the namespace and the resource properties.");const u=Object(o.useRef)({results:[],isLoading:!0}),b=Object(a.a)(s),d=Object(a.a)(l),m=(()=>{const[,e]=Object(o.useState)();return Object(o.useCallback)((t=>{e((()=>{throw t}))}),[])})(),p=Object(r.useSelect)((e=>{if(!i)return null;const r=e(c.COLLECTIONS_STORE_KEY),o=[t,n,b,d],a=r.getCollectionError(...o);if(a){if(!(a instanceof Error))throw new Error("TypeError: `error` object is not an instance of Error constructor");m(a)}return{results:r.getCollection(...o),isLoading:!r.hasFinishedResolution("getCollection",o)}}),[t,n,d,b,i]);return null!==p&&(u.current=p),u.current}},125:function(e,t,n){"use strict";var c=n(0),r=n(1),o=n(29);n(290),t.a=({name:e,count:t})=>Object(c.createElement)(c.Fragment,null,e,null!==t&&Number.isFinite(t)&&Object(c.createElement)(o.a,{label:t.toString(),screenReaderLabel:Object(r.sprintf)(/* translators: %s number of products. */
Object(r._n)("%s product","%s products",t,"woocommerce"),t),wrapperElement:"span",wrapperProps:{className:"wc-filter-element-label-list-count"}}))},129:function(e){e.exports=JSON.parse('{"name":"woocommerce/attribute-filter","version":"1.0.0","title":"Filter by Attribute Controls","description":"Enable customers to filter the product grid by selecting one or more attributes, such as color.","category":"woocommerce","keywords":["WooCommerce"],"supports":{"html":false,"color":{"text":true,"background":false},"inserter":false,"lock":false},"attributes":{"className":{"type":"string","default":""},"attributeId":{"type":"number","default":0},"showCounts":{"type":"boolean","default":false},"queryType":{"type":"string","default":"or"},"headingLevel":{"type":"number","default":3},"displayStyle":{"type":"string","default":"list"},"showFilterButton":{"type":"boolean","default":false},"selectType":{"type":"string","default":"multiple"},"isPreview":{"type":"boolean","default":false}},"textdomain":"woocommerce","apiVersion":2,"$schema":"https://schemas.wp.org/trunk/block.json"}')},13:function(e,t){e.exports=window.wc.blocksCheckout},134:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var c=n(0),r=n(1),o=n(7),a=n(6),l=n(2),s=n(5);const i=({clientId:e,setAttributes:t,filterType:n,attributes:i})=>{const{replaceBlock:u}=Object(a.useDispatch)("core/block-editor"),{heading:b,headingLevel:d}=i;if(Object(a.useSelect)((t=>{const{getBlockParentsByBlockName:n}=t("core/block-editor");return n(e,"woocommerce/filter-wrapper").length>0}),[e])||!n)return null;const m=[Object(c.createElement)(l.Button,{key:"convert",onClick:()=>{const c=[Object(o.createBlock)(`woocommerce/${n}`,{...i,heading:""})];b&&""!==b&&c.unshift(Object(o.createBlock)("core/heading",{content:b,level:null!=d?d:2})),u(e,Object(o.createBlock)("woocommerce/filter-wrapper",{heading:b,filterType:n},[...c])),t({heading:"",lock:{remove:!0}})},variant:"primary"},Object(r.__)("Upgrade block","woocommerce"))];return Object(c.createElement)(s.Warning,{actions:m},Object(r.__)("Filter block: We have improved this block to make styling easier. Upgrade it using the button below.","woocommerce"))}},135:function(e,t,n){"use strict";var c=n(0),r=n(5),o=n(11),a=n(1);n(186),t.a=Object(o.withInstanceId)((({className:e,headingLevel:t,onChange:n,heading:o,instanceId:l})=>{const s=`h${t}`;return Object(c.createElement)(s,{className:e},Object(c.createElement)("label",{className:"screen-reader-text",htmlFor:`block-title-${l}`},Object(a.__)("Block title","woocommerce")),Object(c.createElement)(r.PlainText,{id:`block-title-${l}`,className:"wc-block-editor-components-title",value:o,onChange:n,style:{backgroundColor:"transparent"}}))}))},136:function(e,t,n){"use strict";var c=n(0);n(187),t.a=({children:e})=>Object(c.createElement)("div",{className:"wc-block-filter-title-placeholder"},e)},138:function(e,t,n){"use strict";var c=n(0),r=n(1),o=n(4),a=n.n(o),l=n(29);n(190),t.a=({className:e,
/* translators: Reset button text for filters. */
label:t=Object(r.__)("Reset","woocommerce"),onClick:n,screenReaderLabel:o=Object(r.__)("Reset filter","woocommerce")})=>Object(c.createElement)("button",{className:a()("wc-block-components-filter-reset-button",e),onClick:n},Object(c.createElement)(l.a,{label:t,screenReaderLabel:o}))},139:function(e,t,n){"use strict";var c=n(0),r=n(1),o=n(4),a=n.n(o),l=n(29);n(191),t.a=({className:e,isLoading:t,disabled:n,
/* translators: Submit button text for filters. */
label:o=Object(r.__)("Apply","woocommerce"),onClick:s,screenReaderLabel:i=Object(r.__)("Apply filter","woocommerce")})=>Object(c.createElement)("button",{type:"submit",className:a()("wp-block-button__link","wc-block-filter-submit-button","wc-block-components-filter-submit-button",{"is-loading":t},e),disabled:n,onClick:s},Object(c.createElement)(l.a,{label:o,screenReaderLabel:i}))},142:function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){return l}));var c=n(21);const r=e=>Object(c.c)(e,"count")&&Object(c.c)(e,"description")&&Object(c.c)(e,"id")&&Object(c.c)(e,"name")&&Object(c.c)(e,"parent")&&Object(c.c)(e,"slug")&&"number"==typeof e.count&&"string"==typeof e.description&&"number"==typeof e.id&&"string"==typeof e.name&&"number"==typeof e.parent&&"string"==typeof e.slug,o=e=>Array.isArray(e)&&e.every(r),a=e=>Object(c.c)(e,"attribute")&&Object(c.c)(e,"operator")&&Object(c.c)(e,"slug")&&"string"==typeof e.attribute&&"string"==typeof e.operator&&Array.isArray(e.slug)&&e.slug.every((e=>"string"==typeof e)),l=e=>Array.isArray(e)&&e.every(a)},15:function(e,t){e.exports=window.wp.url},157:function(e,t,n){"use strict";n.d(t,"a",(function(){return l})),n.d(t,"b",(function(){return s})),n.d(t,"c",(function(){return i})),n.d(t,"d",(function(){return u}));var c=n(3),r=n(142),o=n(6);const a=Object(c.getSetting)("attributes",[]).reduce(((e,t)=>{const n=(c=t)&&c.attribute_name?{id:parseInt(c.attribute_id,10),name:c.attribute_name,taxonomy:"pa_"+c.attribute_name,label:c.attribute_label}:null;var c;return n&&n.id&&e.push(n),e}),[]),l=e=>{const{count:t,id:n,name:c,parent:o}=e;return{count:t,id:n,name:c,parent:o,breadcrumbs:[],children:[],value:Object(r.b)(e)?e.attr_slug:""}},s=e=>{if(e)return a.find((t=>t.id===e))},i=e=>{if(e)return a.find((t=>t.taxonomy===e))},u=(e,t,n,c)=>{const r=Object(o.select)("core/block-editor"),a=Object(o.dispatch)("core/block-editor"),l=r.getBlockParents(e);let s="";l.forEach((e=>{const t=r.getBlock(e).innerBlocks.find((e=>e.name===c));t&&(s=t.clientId)})),a.updateBlockAttributes(s,{[t]:n})}},16:function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"c",(function(){return s})),n.d(t,"d",(function(){return i})),n.d(t,"b",(function(){return u}));var c=n(0),r=n(1),o=n(57);const a={clear:Object(r.__)("Clear all selected items","woocommerce"),noItems:Object(r.__)("No items found.","woocommerce"),
/* Translators: %s search term */
noResults:Object(r.__)("No results for %s","woocommerce"),search:Object(r.__)("Search for items","woocommerce"),selected:e=>Object(r.sprintf)(/* translators: Number of items selected from list. */
Object(r._n)("%d item selected","%d items selected",e,"woocommerce"),e),updated:Object(r.__)("Search results updated.","woocommerce")},l=(e,t=e)=>{const n=e.reduce(((e,t)=>{const n=t.parent||0;return e[n]||(e[n]=[]),e[n].push(t),e}),{}),c=Object(o.a)(t,"id"),r=["0"],a=(e={})=>e.parent?[...a(c[e.parent]),e.name]:e.name?[e.name]:[],l=e=>e.map((e=>{const t=n[e.id];return r.push(""+e.id),{...e,breadcrumbs:a(c[e.parent]),children:t&&t.length?l(t):[]}})),s=l(n[0]||[]);return Object.entries(n).forEach((([e,t])=>{r.includes(e)||s.push(...l(t||[]))})),s},s=(e,t,n)=>{if(!t)return n?l(e):e;const c=new RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"i"),r=e.map((e=>!!c.test(e.name)&&e)).filter(Boolean);return n?l(r,e):r},i=(e,t)=>{if(!t)return e;const n=new RegExp(`(${t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")})`,"ig");return e.split(n).map(((e,t)=>n.test(e)?Object(c.createElement)("strong",{key:t},e):Object(c.createElement)(c.Fragment,{key:t},e)))},u=e=>1===e.length?e.slice(0,1).toString():2===e.length?e.slice(0,1).toString()+" › "+e.slice(-1).toString():e.slice(0,1).toString()+" … "+e.slice(-1).toString()},17:function(e,t,n){"use strict";n.d(t,"p",(function(){return o})),n.d(t,"n",(function(){return a})),n.d(t,"m",(function(){return l})),n.d(t,"o",(function(){return s})),n.d(t,"k",(function(){return i})),n.d(t,"e",(function(){return u})),n.d(t,"h",(function(){return b})),n.d(t,"l",(function(){return d})),n.d(t,"c",(function(){return m})),n.d(t,"d",(function(){return p})),n.d(t,"g",(function(){return g})),n.d(t,"a",(function(){return f})),n.d(t,"b",(function(){return h})),n.d(t,"i",(function(){return w})),n.d(t,"j",(function(){return _})),n.d(t,"f",(function(){return y}));var c,r=n(3);const o=Object(r.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),a=o.pluginUrl+"images/",l=o.pluginUrl+"build/",s=o.buildPhase,i=null===(c=r.STORE_PAGES.shop)||void 0===c?void 0:c.permalink,u=r.STORE_PAGES.checkout.id,b=(r.STORE_PAGES.checkout.permalink,r.STORE_PAGES.privacy.permalink),d=(r.STORE_PAGES.privacy.title,r.STORE_PAGES.terms.permalink),m=(r.STORE_PAGES.terms.title,r.STORE_PAGES.cart.id),p=r.STORE_PAGES.cart.permalink,g=(r.STORE_PAGES.myaccount.permalink?r.STORE_PAGES.myaccount.permalink:Object(r.getSetting)("wpLoginUrl","/wp-login.php"),Object(r.getSetting)("localPickupEnabled",!1)),O=Object(r.getSetting)("countries",{}),j=Object(r.getSetting)("countryData",{}),f=Object.fromEntries(Object.keys(j).filter((e=>!0===j[e].allowBilling)).map((e=>[e,O[e]||""]))),h=Object.fromEntries(Object.keys(j).filter((e=>!0===j[e].allowBilling)).map((e=>[e,j[e].states||[]]))),w=Object.fromEntries(Object.keys(j).filter((e=>!0===j[e].allowShipping)).map((e=>[e,O[e]||""]))),_=Object.fromEntries(Object.keys(j).filter((e=>!0===j[e].allowShipping)).map((e=>[e,j[e].states||[]]))),y=Object.fromEntries(Object.keys(j).map((e=>[e,j[e].locale||[]])))},170:function(e,t,n){"use strict";var c=n(0),r=n(350),o=n(4),a=n.n(o);n(224),t.a=({className:e,style:t,suggestions:n,multiple:o=!0,saveTransform:l=(e=>e.trim().replace(/\s/g,"-")),messages:s={},validateInput:i=(e=>n.includes(e)),label:u="",...b})=>Object(c.createElement)("div",{className:a()("wc-blocks-components-form-token-field-wrapper",e,{"single-selection":!o}),style:t},Object(c.createElement)(r.a,{label:u,__experimentalExpandOnFocus:!0,__experimentalShowHowTo:!1,__experimentalValidateInput:i,saveTransform:l,maxLength:o?void 0:1,suggestions:n,messages:s,...b}))},171:function(e,t,n){"use strict";var c=n(0),r=n(1),o=n(4),a=n.n(o),l=n(13);n(225),t.a=({className:e,onChange:t,options:n=[],checked:o=[],isLoading:s=!1,isDisabled:i=!1,limit:u=10})=>{const[b,d]=Object(c.useState)(!1),m=Object(c.useMemo)((()=>[...Array(5)].map(((e,t)=>Object(c.createElement)("li",{key:t,style:{width:Math.floor(75*Math.random())+25+"%"}})))),[]),p=Object(c.useMemo)((()=>{const e=n.length-u;return!b&&Object(c.createElement)("li",{key:"show-more",className:"show-more"},Object(c.createElement)("button",{onClick:()=>{d(!0)},"aria-expanded":!1,"aria-label":Object(r.sprintf)(/* translators: %s is referring the remaining count of options */
Object(r._n)("Show %s more option","Show %s more options",e,"woocommerce"),e)},Object(r.sprintf)(/* translators: %s number of options to reveal. */
Object(r._n)("Show %s more","Show %s more",e,"woocommerce"),e)))}),[n,u,b]),g=Object(c.useMemo)((()=>b&&Object(c.createElement)("li",{key:"show-less",className:"show-less"},Object(c.createElement)("button",{onClick:()=>{d(!1)},"aria-expanded":!0,"aria-label":Object(r.__)("Show less options","woocommerce")},Object(r.__)("Show less","woocommerce")))),[b]),O=Object(c.useMemo)((()=>{const e=n.length>u+5;return Object(c.createElement)(c.Fragment,null,n.map(((n,r)=>Object(c.createElement)(c.Fragment,{key:n.value},Object(c.createElement)("li",{...e&&!b&&r>=u&&{hidden:!0}},Object(c.createElement)(l.CheckboxControl,{id:n.value,className:"wc-block-checkbox-list__checkbox",label:n.label,checked:o.includes(n.value),onChange:()=>{t(n.value)},disabled:i})),e&&r===u-1&&p))),e&&g)}),[n,t,o,b,u,g,p,i]),j=a()("wc-block-checkbox-list","wc-block-components-checkbox-list",{"is-loading":s},e);return Object(c.createElement)("ul",{className:j},s?m:O)}},186:function(e,t){},187:function(e,t){},190:function(e,t){},191:function(e,t){},2:function(e,t){e.exports=window.wp.components},204:function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return o}));var c=n(105);const r=(e=[],t,n,r="")=>{const o=e.filter((e=>e.attribute===n.taxonomy)),a=o.length?o[0]:null;if(!(a&&a.slug&&Array.isArray(a.slug)&&a.slug.includes(r)))return;const l=a.slug.filter((e=>e!==r)),s=e.filter((e=>e.attribute!==n.taxonomy));l.length>0&&(a.slug=l.sort(),s.push(a)),t(Object(c.a)(s).asc("attribute"))},o=(e=[],t,n,r=[],o="in")=>{if(!n||!n.taxonomy)return[];const a=e.filter((e=>e.attribute!==n.taxonomy));return 0===r.length?t(a):(a.push({attribute:n.taxonomy,operator:o,slug:r.map((({slug:e})=>e)).sort()}),t(Object(c.a)(a).asc("attribute"))),a}},21:function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){return a}));var c=n(42);const r=e=>!Object(c.a)(e)&&e instanceof Object&&e.constructor===Object;function o(e,t){return r(e)&&t in e}const a=e=>0===Object.keys(e).length},224:function(e,t){},225:function(e,t){},25:function(e,t){e.exports=window.wp.isShallowEqual},259:function(e,t,n){"use strict";n.d(t,"b",(function(){return l})),n.d(t,"a",(function(){return s})),n.d(t,"d",(function(){return i})),n.d(t,"c",(function(){return u})),n.d(t,"e",(function(){return b}));var c=n(15),r=n(3),o=n(80);const a=Object(r.getSettingWithCoercion)("isRenderingPhpTemplate",!1,o.a),l="query_type_",s="filter_";function i(e){return window?Object(c.getQueryArg)(window.location.href,e):null}function u(e){a?((e=e.replace(/(?:query-(?:\d+-)?page=(\d+))|(?:page\/(\d+))/g,"")).endsWith("?")&&(e=e.slice(0,-1)),window.location.href=e):window.history.replaceState({},"",e)}const b=e=>{const t=Object(c.getQueryArgs)(e);return Object(c.addQueryArgs)(e,t)}},26:function(e,t){e.exports=window.React},27:function(e,t){e.exports=window.lodash},29:function(e,t,n){"use strict";var c=n(0),r=n(4),o=n.n(r);t.a=({label:e,screenReaderLabel:t,wrapperElement:n,wrapperProps:r={}})=>{let a;const l=null!=e,s=null!=t;return!l&&s?(a=n||"span",r={...r,className:o()(r.className,"screen-reader-text")},Object(c.createElement)(a,{...r},t)):(a=n||c.Fragment,l&&s&&e!==t?Object(c.createElement)(a,{...r},Object(c.createElement)("span",{"aria-hidden":"true"},e),Object(c.createElement)("span",{className:"screen-reader-text"},t)):Object(c.createElement)(a,{...r},e))}},290:function(e,t){},291:function(e,t,n){"use strict";n.d(t,"a",(function(){return b}));var c=n(0),r=n(41),o=n(21),a=n(105),l=n(47),s=n(62),i=n(120),u=n(50);const b=({queryAttribute:e,queryPrices:t,queryStock:n,queryRating:b,queryState:d,isEditor:m=!1})=>{let p=Object(u.a)();p=`${p}-collection-data`;const[g]=Object(s.a)(p),[O,j]=Object(s.b)("calculate_attribute_counts",[],p),[f,h]=Object(s.b)("calculate_price_range",null,p),[w,_]=Object(s.b)("calculate_stock_status_counts",null,p),[y,E]=Object(s.b)("calculate_rating_counts",null,p),k=Object(l.a)(e||{}),v=Object(l.a)(t),S=Object(l.a)(n),C=Object(l.a)(b);Object(c.useEffect)((()=>{"object"==typeof k&&Object.keys(k).length&&(O.find((e=>Object(o.c)(k,"taxonomy")&&e.taxonomy===k.taxonomy))||j([...O,k]))}),[k,O,j]),Object(c.useEffect)((()=>{f!==v&&void 0!==v&&h(v)}),[v,h,f]),Object(c.useEffect)((()=>{w!==S&&void 0!==S&&_(S)}),[S,_,w]),Object(c.useEffect)((()=>{y!==C&&void 0!==C&&E(C)}),[C,E,y]);const[x,N]=Object(c.useState)(m),[T]=Object(r.a)(x,200);x||N(!0);const A=Object(c.useMemo)((()=>(e=>{const t=e;return Array.isArray(e.calculate_attribute_counts)&&(t.calculate_attribute_counts=Object(a.a)(e.calculate_attribute_counts.map((({taxonomy:e,queryType:t})=>({taxonomy:e,query_type:t})))).asc(["taxonomy","query_type"])),t})(g)),[g]);return Object(i.a)({namespace:"/wc/store/v1",resourceName:"products/collection-data",query:{...d,page:void 0,per_page:void 0,orderby:void 0,order:void 0,...A},shouldSelect:T})}},3:function(e,t){e.exports=window.wc.wcSettings},35:function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var c=n(0),r=n(4),o=n.n(r),a=n(2);function l(e,t,n){const c=new Set(t.map((e=>e[n])));return e.filter((e=>!c.has(e[n])))}var s=n(10),i=n(16);const u=({label:e})=>Object(c.createElement)("span",{className:"woocommerce-search-list__item-count"},e),b=e=>{const{item:t,search:n}=e,r=t.breadcrumbs&&t.breadcrumbs.length;return Object(c.createElement)("span",{className:"woocommerce-search-list__item-label"},r?Object(c.createElement)("span",{className:"woocommerce-search-list__item-prefix"},Object(i.b)(t.breadcrumbs)):null,Object(c.createElement)("span",{className:"woocommerce-search-list__item-name"},Object(i.d)(Object(s.decodeEntities)(t.name),n)))},d=({countLabel:e,className:t,depth:n=0,controlId:r="",item:d,isSelected:m,isSingle:p,onSelect:g,search:O="",selected:j,useExpandedPanelId:f,...h})=>{var w,_;const[y,E]=f,k=null!=e&&void 0!==d.count&&null!==d.count,v=!(null===(w=d.breadcrumbs)||void 0===w||!w.length),S=!(null===(_=d.children)||void 0===_||!_.length),C=y===d.id,x=o()(["woocommerce-search-list__item",`depth-${n}`,t],{"has-breadcrumbs":v,"has-children":S,"has-count":k,"is-expanded":C,"is-radio-button":p}),N=h.name||`search-list-item-${r}`,T=`${N}-${d.id}`,A=Object(c.useCallback)((()=>{E(C?-1:Number(d.id))}),[C,d.id,E]);return S?Object(c.createElement)("div",{className:x,onClick:A,onKeyDown:e=>"Enter"===e.key||" "===e.key?A():null,role:"treeitem",tabIndex:0},p?Object(c.createElement)(c.Fragment,null,Object(c.createElement)("input",{type:"radio",id:T,name:N,value:d.value,onChange:g(d),onClick:e=>e.stopPropagation(),checked:m,className:"woocommerce-search-list__item-input",...h}),Object(c.createElement)(b,{item:d,search:O}),k?Object(c.createElement)(u,{label:e||d.count}):null):Object(c.createElement)(c.Fragment,null,Object(c.createElement)(a.CheckboxControl,{className:"woocommerce-search-list__item-input",checked:m,...!m&&d.children.some((e=>j.find((t=>t.id===e.id))))?{indeterminate:!0}:{},label:Object(i.d)(Object(s.decodeEntities)(d.name),O),onChange:()=>{m?g(l(j,d.children,"id"))():g(function(e,t,n){const c=l(t,e,"id");return[...e,...c]}(j,d.children))()},onClick:e=>e.stopPropagation()}),k?Object(c.createElement)(u,{label:e||d.count}):null)):Object(c.createElement)("label",{htmlFor:T,className:x},p?Object(c.createElement)(c.Fragment,null,Object(c.createElement)("input",{type:"radio",id:T,name:N,value:d.value,onChange:g(d),checked:m,className:"woocommerce-search-list__item-input",...h}),Object(c.createElement)(b,{item:d,search:O})):Object(c.createElement)(a.CheckboxControl,{id:T,name:N,className:"woocommerce-search-list__item-input",value:Object(s.decodeEntities)(d.value),label:Object(i.d)(Object(s.decodeEntities)(d.name),O),onChange:g(d),checked:m,...h}),k?Object(c.createElement)(u,{label:e||d.count}):null)};t.b=d},37:function(e,t){e.exports=window.wp.deprecated},42:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));const c=e=>null===e},438:function(e,t,n){e.exports=n(568)},439:function(e,t){},440:function(e,t){},46:function(e,t){e.exports=window.wp.a11y},47:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var c=n(0),r=n(25),o=n.n(r);function a(e){const t=Object(c.useRef)(e);return o()(e,t.current)||(t.current=e),t.current}},5:function(e,t){e.exports=window.wp.blockEditor},50:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var c=n(0);const r=Object(c.createContext)("page"),o=()=>Object(c.useContext)(r);r.Provider},54:function(e,t){},55:function(e,t){},568:function(e,t,n){"use strict";n.r(t);var c=n(0),r=n(7),o=n(5),a=n(70),l=n(628),s=n(4),i=n.n(s),u=n(105),b=n(1),d=n(211),m=n(102),p=n(3),g=n(135),O=n(2),j=n(47),f=n(103),h=n(62),w=n(120),_=n(291),y=n(125),E=n(138),k=n(139),v=n(25),S=n.n(v),C=n(10),x=n(15),N=n(80),T=n(113),A=n(21),P=n(142),R=n(630),I=n(259),L=n(170),B=n(136),F=n(157),q=n(204);const $=[{value:"preview-1",formattedValue:"preview-1",name:"Blue",label:Object(c.createElement)(y.a,{name:"Blue",count:3}),textLabel:"Blue (3)"},{value:"preview-2",formattedValue:"preview-2",name:"Green",label:Object(c.createElement)(y.a,{name:"Green",count:3}),textLabel:"Green (3)"},{value:"preview-3",formattedValue:"preview-3",name:"Red",label:Object(c.createElement)(y.a,{name:"Red",count:2}),textLabel:"Red (2)"}],G={count:0,has_archives:!0,id:0,label:"Preview",name:"preview",order:"menu_order",parent:0,taxonomy:"preview",type:""};n(440);var D=n(129);function M(){return Math.floor(Math.random()*Date.now())}const Q=e=>e.replace("pa_",""),V=(e,t=[])=>{const n={};t.forEach((e=>{const{attribute:t,slug:c,operator:r}=e,o=Q(t),a=c.join(","),l=`${I.b}${o}`,s="in"===r?"or":"and";n[`${I.a}${o}`]=a,n[l]=s}));const c=Object(x.removeQueryArgs)(e,...Object.keys(n));return Object(x.addQueryArgs)(c,n)},U=e=>{if(e){const t=Object(I.d)(`filter_${e.name}`);return("string"==typeof t?t.split(","):[]).map((e=>encodeURIComponent(e).toLowerCase()))}return[]},Y=e=>e.trim().replace(/\s/g,"-").replace(/_/g,"-").replace(/-+/g,"-").replace(/[^a-zA-Z0-9-]/g,"");var W=n(171),K=({isLoading:e=!1,options:t,checked:n,onChange:r})=>e?Object(c.createElement)(c.Fragment,null,Object(c.createElement)("span",{className:"is-loading"}),Object(c.createElement)("span",{className:"is-loading"})):Object(c.createElement)(W.a,{className:"wc-block-attribute-filter-list",options:t,checked:n,onChange:r,isLoading:e,isDisabled:e}),z=n(114),H=({attributes:e,isEditor:t=!1,getNotice:n=(()=>null)})=>{const r=Object(p.getSettingWithCoercion)("hasFilterableProducts",!1,N.a),o=Object(p.getSettingWithCoercion)("isRenderingPhpTemplate",!1,N.a),l=Object(p.getSettingWithCoercion)("pageUrl",window.location.href,T.a),[s,u]=Object(c.useState)(!1),d=e.isPreview&&!e.attributeId?G:Object(F.b)(e.attributeId),m=Object(c.useMemo)((()=>U(d)),[d]),[g,O]=Object(c.useState)(m),[v,D]=Object(c.useState)(M()),[W,H]=Object(c.useState)(e.isPreview&&!e.attributeId?$:[]),[J]=Object(h.a)(),[Z,X]=Object(h.b)("attributes",[]),{results:ee,isLoading:te}=Object(w.a)({namespace:"/wc/store/v1",resourceName:"products/attributes/terms",resourceValues:[(null==d?void 0:d.id)||0],shouldSelect:e.attributeId>0}),{results:ne,isLoading:ce}=Object(_.a)({queryAttribute:{taxonomy:(null==d?void 0:d.taxonomy)||"",queryType:e.queryType},queryState:{...J},isEditor:t}),re=Object(c.useCallback)((e=>Object(A.c)(ne,"attribute_counts")&&Array.isArray(ne.attribute_counts)?ne.attribute_counts.find((({term:t})=>t===e)):null),[ne]);Object(c.useEffect)((()=>{if(te||ce)return;if(!Array.isArray(ee))return;const t=ee.map((t=>{const n=re(t.id);if(!(n||g.includes(t.slug)||(r=t.slug,null!=J&&J.attributes&&J.attributes.some((({attribute:e,slug:t=[]})=>e===(null==d?void 0:d.taxonomy)&&t.includes(r))))))return null;var r;const o=n?n.count:0;return{formattedValue:Y(t.slug),value:t.slug,name:Object(C.decodeEntities)(t.name),label:Object(c.createElement)(y.a,{name:Object(C.decodeEntities)(t.name),count:e.showCounts?o:null}),textLabel:e.showCounts?`${Object(C.decodeEntities)(t.name)} (${o})`:Object(C.decodeEntities)(t.name)}})).filter((e=>!!e));H(t),D(M())}),[null==d?void 0:d.taxonomy,ee,te,e.showCounts,ce,re,g,J.attributes]);const oe=Object(c.useCallback)((e=>Array.isArray(ee)?ee.reduce(((t,n)=>(e.includes(n.slug)&&t.push(n),t)),[]):[]),[ee]),ae=Object(c.useCallback)(((e,t=!1)=>{if(e=e.map((e=>({...e,slug:e.slug.map((e=>decodeURIComponent(e)))}))),t){if(null==d||!d.taxonomy)return;const t=Object.keys(Object(x.getQueryArgs)(window.location.href)),n=Q(d.taxonomy),c=t.reduce(((e,t)=>t.includes(I.b+n)||t.includes(I.a+n)?Object(x.removeQueryArgs)(e,t):e),window.location.href),r=V(c,e);Object(I.c)(r)}else{const t=V(l,e);((e,t)=>{const n=Object.entries(t).reduce(((e,[t,n])=>t.includes("query_type")?e:{...e,[t]:n}),{});return Object.entries(n).reduce(((t,[n,c])=>e[n]===c&&t),!0)})(Object(x.getQueryArgs)(window.location.href),Object(x.getQueryArgs)(t))||Object(I.c)(t)}}),[l,null==d?void 0:d.taxonomy]),le=t=>{const n=Object(q.b)(Z,X,d,oe(t),"or"===e.queryType?"in":"and");ae(n,0===t.length)},se=Object(c.useCallback)(((n,c=!1)=>{t||(O(n),!c&&e.showFilterButton||Object(q.b)(Z,X,d,oe(n),"or"===e.queryType?"in":"and"))}),[t,O,Z,X,d,oe,e.queryType,e.showFilterButton]),ie=Object(c.useMemo)((()=>Object(P.a)(Z)?Z.filter((({attribute:e})=>e===(null==d?void 0:d.taxonomy))).flatMap((({slug:e})=>e)):[]),[Z,null==d?void 0:d.taxonomy]),ue=Object(j.a)(ie),be=Object(f.a)(ue);Object(c.useEffect)((()=>{!be||S()(be,ue)||S()(g,ue)||se(ue)}),[g,ue,be,se]);const de="single"!==e.selectType,me=Object(c.useCallback)((e=>{const t=g.includes(e);let n;de?(n=g.filter((t=>t!==e)),t||(n.push(e),n.sort())):n=t?[]:[e],se(n)}),[g,de,se]);Object(c.useEffect)((()=>{d&&!e.showFilterButton&&((({currentCheckedFilters:e,hasSetFilterDefaultsFromUrl:t})=>t&&0===e.length)({currentCheckedFilters:g,hasSetFilterDefaultsFromUrl:s})?ae(Z,!0):ae(Z,!1))}),[s,ae,Z,d,g,e.showFilterButton]),Object(c.useEffect)((()=>{if(!s&&!te)return m.length>0?(u(!0),void se(m,!0)):void(o||u(!0))}),[d,s,te,se,m,o]);const pe=Object(z.a)();if(!r)return pe(!1),null;if(!d)return t?n("noAttributes"):(pe(!1),null);if(0===W.length&&!te&&t)return n("noProducts");const ge=`h${e.headingLevel}`,Oe=!e.isPreview&&te,je=!e.isPreview&&ce,fe=(Oe||je)&&0===W.length;if(!fe&&0===W.length)return pe(!1),null;const he=de?!fe&&g.length<W.length:!fe&&0===g.length,we=Object(c.createElement)(ge,{className:"wc-block-attribute-filter__title"},e.heading),_e=fe?Object(c.createElement)(B.a,null,we):we;return pe(!0),Object(c.createElement)(c.Fragment,null,!t&&e.heading&&_e,Object(c.createElement)("div",{className:i()("wc-block-attribute-filter",`style-${e.displayStyle}`)},"dropdown"===e.displayStyle?Object(c.createElement)(c.Fragment,null,Object(c.createElement)(L.a,{key:v,className:i()({"single-selection":!de,"is-loading":fe}),suggestions:W.filter((e=>!g.includes(e.value))).map((e=>e.formattedValue)),disabled:fe,placeholder:Object(b.sprintf)(/* translators: %s attribute name. */
Object(b.__)("Select %s","woocommerce"),d.label),onChange:e=>{!de&&e.length>1&&(e=[e[e.length-1]]);const t=[e=e.map((e=>{const t=W.find((t=>t.formattedValue===e));return t?t.value:e})),g].reduce(((e,t)=>e.filter((e=>!t.includes(e)))));if(1===t.length)return me(t[0]);const n=[g,e].reduce(((e,t)=>e.filter((e=>!t.includes(e)))));1===n.length&&me(n[0])},value:g,displayTransform:e=>{const t=W.find((t=>[t.value,t.formattedValue].includes(e)));return t?t.textLabel:e},saveTransform:Y,messages:{added:Object(b.sprintf)(/* translators: %s is the attribute label. */
Object(b.__)("%s filter added.","woocommerce"),d.label),removed:Object(b.sprintf)(/* translators: %s is the attribute label. */
Object(b.__)("%s filter removed.","woocommerce"),d.label),remove:Object(b.sprintf)(/* translators: %s is the attribute label. */
Object(b.__)("Remove %s filter.","woocommerce"),d.label.toLocaleLowerCase()),__experimentalInvalid:Object(b.sprintf)(/* translators: %s is the attribute label. */
Object(b.__)("Invalid %s filter.","woocommerce"),d.label.toLocaleLowerCase())}}),he&&Object(c.createElement)(a.a,{icon:R.a,size:30})):Object(c.createElement)(K,{options:W,checked:g,onChange:me,isLoading:fe,isDisabled:fe})),Object(c.createElement)("div",{className:"wc-block-attribute-filter__actions"},(g.length>0||t)&&!fe&&Object(c.createElement)(E.a,{onClick:()=>{O([]),D(M()),s&&le([])},screenReaderLabel:Object(b.__)("Reset attribute filter","woocommerce")}),e.showFilterButton&&Object(c.createElement)(k.a,{className:"wc-block-attribute-filter__button",isLoading:fe,disabled:(()=>{if(Oe||je)return!0;const e=U(d);return e.length===g.length&&g.every((t=>e.includes(t)))})(),onClick:()=>le(g)})))},J=(n(439),n(134));const Z=Object(p.getSetting)("attributes",[]),X={noAttributes:Object(b.__)("Please select an attribute to use this filter!","woocommerce"),noProducts:Object(b.__)("There are no products with the selected attributes.","woocommerce")},ee=e=>{const t=X[e];return t?Object(c.createElement)(O.Notice,{status:"warning",isDismissible:!1},Object(c.createElement)("p",null,t)):null};var te=Object(O.withSpokenMessages)((({attributes:e,setAttributes:t,debouncedSpeak:n,clientId:r})=>{const{attributeId:s,displayStyle:j,heading:f,headingLevel:h,isPreview:w,queryType:_,showCounts:y,showFilterButton:E,selectType:k}=e,[v,S]=Object(c.useState)(!s&&!w),C=Object(o.useBlockProps)(),x=e=>{if(!e||!e.length)return;const n=e[0].id;Z.find((e=>e.attribute_id===n.toString()))&&s!==n&&t({attributeId:n})},N=({isCompact:e})=>{const t={clear:Object(b.__)("Clear selected attribute","woocommerce"),list:Object(b.__)("Product Attributes","woocommerce"),noItems:Object(b.__)("Your store doesn't have any product attributes.","woocommerce"),search:Object(b.__)("Search for a product attribute:","woocommerce"),selected:e=>Object(b.sprintf)(/* translators: %d is the number of attributes selected. */
Object(b._n)("%d attribute selected","%d attributes selected",e,"woocommerce"),e),updated:Object(b.__)("Product attribute search results updated.","woocommerce")},n=Object(u.a)(Z.map((e=>({id:parseInt(e.attribute_id,10),name:e.attribute_label})))).asc("name");return Object(c.createElement)(m.a,{className:"woocommerce-product-attributes",list:n,selected:n.filter((({id:e})=>e===s)),onChange:x,messages:t,isSingle:!0,isCompact:e})};return 0===Object.keys(Z).length?Object(c.createElement)(O.Placeholder,{className:"wc-block-attribute-filter",icon:Object(c.createElement)(a.a,{icon:l.a}),label:Object(b.__)("Filter by Attribute","woocommerce"),instructions:Object(b.__)("Display a list of filters based on the selected attributes.","woocommerce")},Object(c.createElement)("p",null,Object(b.__)("Attributes are needed for filtering your products. You haven't created any attributes yet.","woocommerce")),Object(c.createElement)(O.Button,{className:"wc-block-attribute-filter__add-attribute-button",isSecondary:!0,href:Object(p.getAdminLink)("edit.php?post_type=product&page=product_attributes"),target:"_top"},Object(b.__)("Add new attribute","woocommerce")+" ",Object(c.createElement)(a.a,{icon:d.a})),Object(c.createElement)(O.Button,{className:"wc-block-attribute-filter__read_more_button",isTertiary:!0,href:"https://docs.woocommerce.com/document/managing-product-taxonomies/",target:"_blank"},Object(b.__)("Learn more","woocommerce"))):Object(c.createElement)("div",{...C},Object(c.createElement)(o.BlockControls,null,Object(c.createElement)(O.ToolbarGroup,{controls:[{icon:"edit",title:Object(b.__)("Edit","woocommerce"),onClick:()=>S(!v),isActive:v}]})),Object(c.createElement)(o.InspectorControls,{key:"inspector"},Object(c.createElement)(O.PanelBody,{title:Object(b.__)("Display Settings","woocommerce")},Object(c.createElement)(O.ToggleControl,{label:Object(b.__)("Display product count","woocommerce"),checked:y,onChange:()=>t({showCounts:!y})}),Object(c.createElement)(O.__experimentalToggleGroupControl,{label:Object(b.__)("Allow selecting multiple options?","woocommerce"),value:k||"multiple",onChange:e=>t({selectType:e}),className:"wc-block-attribute-filter__multiple-toggle"},Object(c.createElement)(O.__experimentalToggleGroupControlOption,{value:"multiple",label:Object(b.__)("Multiple","woocommerce")}),Object(c.createElement)(O.__experimentalToggleGroupControlOption,{value:"single",label:Object(b.__)("Single","woocommerce")})),"multiple"===k&&Object(c.createElement)(O.__experimentalToggleGroupControl,{label:Object(b.__)("Filter Conditions","woocommerce"),help:"and"===_?Object(b.__)("Choose to return filter results for all of the attributes selected.","woocommerce"):Object(b.__)("Choose to return filter results for any of the attributes selected.","woocommerce"),value:_,onChange:e=>t({queryType:e}),className:"wc-block-attribute-filter__conditions-toggle"},Object(c.createElement)(O.__experimentalToggleGroupControlOption,{value:"and",label:Object(b.__)("All","woocommerce")}),Object(c.createElement)(O.__experimentalToggleGroupControlOption,{value:"or",label:Object(b.__)("Any","woocommerce")})),Object(c.createElement)(O.__experimentalToggleGroupControl,{label:Object(b.__)("Display Style","woocommerce"),value:j,onChange:e=>t({displayStyle:e}),className:"wc-block-attribute-filter__display-toggle"},Object(c.createElement)(O.__experimentalToggleGroupControlOption,{value:"list",label:Object(b.__)("List","woocommerce")}),Object(c.createElement)(O.__experimentalToggleGroupControlOption,{value:"dropdown",label:Object(b.__)("Dropdown","woocommerce")})),Object(c.createElement)(O.ToggleControl,{label:Object(b.__)("Show 'Apply filters' button","woocommerce"),help:Object(b.__)("Products will update when the button is clicked.","woocommerce"),checked:E,onChange:e=>t({showFilterButton:e})})),Object(c.createElement)(O.PanelBody,{title:Object(b.__)("Content Settings","woocommerce"),initialOpen:!1},N({isCompact:!0}))),Object(c.createElement)(J.a,{clientId:r,attributes:e,setAttributes:t,filterType:"attribute-filter"}),v?Object(c.createElement)(O.Placeholder,{className:"wc-block-attribute-filter",icon:Object(c.createElement)(a.a,{icon:l.a}),label:Object(b.__)("Filter by Attribute","woocommerce")},Object(c.createElement)("div",{className:"wc-block-attribute-filter__instructions"},Object(b.__)("Display a list of filters based on the selected attributes.","woocommerce")),Object(c.createElement)("div",{className:"wc-block-attribute-filter__selection"},N({isCompact:!1}),Object(c.createElement)(O.Button,{isPrimary:!0,onClick:()=>{S(!1),n(Object(b.__)("Now displaying a preview of the Filter Products by Attribute block.","woocommerce"))}},Object(b.__)("Done","woocommerce")))):Object(c.createElement)("div",{className:i()("wc-block-attribute-filter")},f&&Object(c.createElement)(g.a,{className:"wc-block-attribute-filter__title",headingLevel:h,heading:f,onChange:e=>t({heading:e})}),Object(c.createElement)(O.Disabled,null,Object(c.createElement)(H,{attributes:e,isEditor:!0,getNotice:ee}))))}));const ne={heading:{type:"string",default:Object(b.__)("Filter by attribute","woocommerce")}};var ce=n(83),re=[{supports:{...D.supports,...Object(ce.b)()&&{__experimentalBorder:{radius:!1,color:!0,width:!1}}},attributes:{...D.attributes,showCounts:{type:"boolean",default:!0},...ne},save:({attributes:e})=>{const{className:t,showCounts:n,queryType:r,attributeId:a,heading:l,headingLevel:s,displayStyle:u,showFilterButton:b,selectType:d}=e,m={"data-attribute-id":a,"data-show-counts":n,"data-query-type":r,"data-heading":l,"data-heading-level":s};return"list"!==u&&(m["data-display-style"]=u),b&&(m["data-show-filter-button"]=b),"single"===d&&(m["data-select-type"]=d),Object(c.createElement)("div",{...o.useBlockProps.save({className:i()("is-loading",t)}),...m},Object(c.createElement)("span",{"aria-hidden":!0,className:"wc-block-product-attribute-filter__placeholder"}))}}];Object(r.registerBlockType)(D,{icon:{src:Object(c.createElement)(a.a,{icon:l.a,className:"wc-block-editor-components-block-icon"})},supports:{...D.supports},attributes:{...D.attributes,...ne},edit:te,save({attributes:e}){const{className:t}=e;return Object(c.createElement)("div",{...o.useBlockProps.save({className:i()("is-loading",t)})})},deprecated:re})},57:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));const c=(e,t)=>e.reduce(((e,n)=>(e[String(t?n[t]:n)]=n,e)),{})},58:function(e,t){e.exports=window.wp.keycodes},6:function(e,t){e.exports=window.wp.data},62:function(e,t,n){"use strict";n.d(t,"a",(function(){return b})),n.d(t,"b",(function(){return d})),n.d(t,"c",(function(){return m}));var c=n(8),r=n(6),o=n(0),a=n(25),l=n.n(a),s=n(47),i=n(103),u=n(50);const b=e=>{const t=Object(u.a)();e=e||t;const n=Object(r.useSelect)((t=>t(c.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)),[e]),{setValueForQueryContext:a}=Object(r.useDispatch)(c.QUERY_STATE_STORE_KEY);return[n,Object(o.useCallback)((t=>{a(e,t)}),[e,a])]},d=(e,t,n)=>{const a=Object(u.a)();n=n||a;const l=Object(r.useSelect)((r=>r(c.QUERY_STATE_STORE_KEY).getValueForQueryKey(n,e,t)),[n,e]),{setQueryValue:s}=Object(r.useDispatch)(c.QUERY_STATE_STORE_KEY);return[l,Object(o.useCallback)((t=>{s(n,e,t)}),[n,e,s])]},m=(e,t)=>{const n=Object(u.a)();t=t||n;const[c,r]=b(t),a=Object(s.a)(c),d=Object(s.a)(e),m=Object(i.a)(d),p=Object(o.useRef)(!1);return Object(o.useEffect)((()=>{l()(m,d)||(r(Object.assign({},a,d)),p.current=!0)}),[a,d,m,r]),p.current?[c,r]:[e,r]}},7:function(e,t){e.exports=window.wp.blocks},78:function(e,t){e.exports=window.wp.dom},8:function(e,t){e.exports=window.wc.wcBlocksData},80:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));const c=e=>"boolean"==typeof e},83:function(e,t,n){"use strict";n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return l}));var c=n(7),r=n(17);const o=(e,t)=>{if(r.o>2)return Object(c.registerBlockType)(e,t)},a=()=>r.o>2,l=()=>r.o>1},9:function(e,t){e.exports=window.wp.primitives}});